# BeerSong.rb
# July 28, 2007
#

def bottle(i)
  "bottle#{'s' if i>1} of beer"
end

def main
  i=99
  while i>0 do 
    puts "\n#{i} #{bottle(i)} on the wall, #{i} #{bottle(i)}.\n" + 
         "#{i>1? "Take one down and pass it around":"Go to the store and buy some more"}, " +
         "#{i-1==0?99:i-1} bottle#{'s' if i!=2} of beer on the wall.\n"
       i-=1
  end
end

main